const loginInfo = (options) => {
    // console.log('===options===', options)
    const currentTimeStamp = new Date().getTime() // 30s有效
    const shortToken = '123456'
    const longToken = '1234567890'
    const optionsBody = options.body ? JSON.parse(options.body) : ''
    if (!optionsBody) {
        return {
            status: 500,
            message: 'fail',
            data: ''
        }
    }
    const { userName, password } = optionsBody
    const accountList = ['280210', '123456', '13631047217']
    const passList = ['280210', 'yW3=hD', '123456']
    if (!accountList.includes(userName) || !passList.includes(password)) {
        return {
            status: 401,
            message: '用户名或密码错误',
            data: ''
        }
    }
    return {
        status: 200,
        message: 'success',
        data: {
            token: shortToken,
            refreshToken: longToken,
            userName: 'admin',
            fullName: 'admin',
            roleId: 999999,
            roleName: '最高管理员',
            phone: '13631047217',
            timestamp: currentTimeStamp,
            expires: 30
        }
    }
}
export default {
    'post|/api/testStudy/service/token': (options) => loginInfo(options)
}
